<!DOCTYPE HTML PUBdtC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>oscP5 : : OscP5 : : flush ( )</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
document.getElementsByTagName('html')[0].className = 'isjs';

function toggle(dt) 
{ 
  var display, dd=dt; 
  /* get dd */ 
  do{ dd = dd.nextSibling } while(dd.tagName!='DD'); 
  toOpen =!dd.style.display; 
  dd.style.display = toOpen? 'block':'' 
  dt.getElementsByTagName('span')[0].innerHTML 
    = toOpen? '-':'+' ; 
} 
</script>
</head>
<body>
<div id="container">
	<div id="header">
	<a href="./index.htm"><img src="./docuImages/title.jpg" /></a>
	</div>
	<div class="content">
	<h1><a href="index.htm">oscP5</a> / <a href="OscP5_class_OscP5.htm">OscP5</a> / flush( )</h1>
		<div class="separator">
		<dl><dt class="key">name</dt><dd class="value">flush ( )</dd></dl>
		</div>
		<dl><dt class="key">description</dt><dd class="value">a static method to send an OscMessage straight out of the box without
 having to instantiate oscP5.&nbsp;</dd></dl>
		
		<div class="toggleList example">
			<dl><dt onclick="toggle(this)"><span>+</span>Examples</dt>
			<dd><pre> /**
 * oscP5flush by andreas schlegel
 * example shows how to send osc messages without having to instantiate an oscP5 object.
 * this can be useful if you are not listening for incoming messages and you
 * want to avoid to have the additional oscP5 thread running listening for incoming 
 * message (which you wont need if you are only sending messages).
 * oscP5 website at http://www.sojamo.de/oscP5
 */
 
import oscP5.*;
import netP5.*;


NetAddress myRemoteLocation;
void setup() {
  size(400,400);
  frameRate(25);
  /* set up a remote location */
  myRemoteLocation = new NetAddress("127.0.0.1",12000);
}


void draw() {
  background(0);
}


void mousePressed() {
  /* create a new OscMessage with an address pattern, in this case /test. */
  OscMessage myOscMessage = new OscMessage("/test");
  
  /* add a value (an integer) to the OscMessage */
  myOscMessage.add(100);
  
  /* send the OscMessage to the remote location. 
   */
  OscP5.flush(myOscMessage,myRemoteLocation);
}
</pre></dd>
			</dl>
		</div>
		
		<div class="separator">
		<dl><dt class="key">Syntax</dt><dd class="value"><pre>flush(theOscMessage, theNetAddress);
flush(theAddrPattern, theArguments, theNetAddress);
flush(theBytes, theNetAddress);
flush(theBytes, theAddress, thePort);
flush(theOscMessage, theAddress, thePort);
</pre></dd></dl>
		</div>
		<div class="separator">
		
   <dl><dt class="key">parameters</dt><dd class="value"><span class="parameters">theOscMessage</span><span class="parameters">OscMessage</span><span class="clear">&nbsp;</span></dd>
<dd class="value"><span class="parameters">theNetAddress</span><span class="parameters">NetAddress</span><span class="clear">&nbsp;</span></dd>
<dd class="value"><span class="parameters">theBytes</span><span class="parameters">byte[]</span><span class="clear">&nbsp;</span></dd>
<dd class="value"><span class="parameters">theAddress</span><span class="parameters">String</span><span class="clear">&nbsp;</span></dd>
<dd class="value"><span class="parameters">thePort</span><span class="parameters">int</span><span class="clear">&nbsp;</span></dd>
</dl>
		<br /><br />
		</div>
		<div class="separator">
		<dl><dt class="key">Returns</dt><dd class="value">None</dd></dl>

		</div>
		<div class="separator">
		<dl><dt class="key">Usage</dt><dd class="value">Web & Application</dd></dl>
		</div>
		<div class="separator">
		<dl><dt class="key">Related</dt><dd class="value"><ul></ul></dd></dl>
		</div>
	</div>
	<div id="footer">
<p>by andreas schlegel (<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" target="_blank">cc</a>) 2007, <a href="http://www.sojamo.de" target="_blank">sojamo</a>.</p>
</div>

</div>
</body>
</html>